<script setup lang="ts">
//引入子组件
import { ref } from 'vue';
import ChildComp from './components/ChildComp.vue'


const flag = ref(true)
</script>

<template>
  <div class="app-page">
    <div>我是父组件</div>
    <!-- 使用子组件 -->
    <ChildComp v-if="flag"/>
    <button @click="flag = false">毁灭吧</button>
  </div>
</template>

<style lang="css" scoped></style>
